package com.gateway.springboot.starter.router.ratelimiter;

import com.gateway.router.ratelimiter.resolver.KeyResolverFactory;
import com.gateway.router.ratelimiter.resolver.RemoteAddrKeyResolver;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.cloud.gateway.config.conditional.ConditionalOnEnabledFilter;
import org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory;
import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
import org.springframework.cloud.gateway.filter.ratelimit.RateLimiter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: api-gateway
 * @description:
 * @author: YuKai Fan
 * @create: 2025/2/21 16:16
 **/
@Configuration
public class RateLimiterRouterConfiguration {

    @Bean(name = KeyResolverFactory.BEAN_NAME)
    public KeyResolver keyResolverFactory(){
        return new KeyResolverFactory();
    }
}
